﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace QuanLyDuocPham.View.QuanLyCauHinh.NguoiDung
{
    /// <summary>
    /// Interaction logic for NHOMND_Edit_View.xaml
    /// </summary>
    public partial class NHOMND_Edit_View : Window
    {
        public NHOMND_Edit_View()
        {
            InitializeComponent();
        }

        public delegate void added();
        public added done;

        string ma_nhom_nd;

        public string _ma_nhom_nd
        {
            set
            {
                ma_nhom_nd = value;
            }
        }
        Controllers.QuanLyCauHinh.NguoiDung.NHOMND_Control nhomndctrl = new Controllers.QuanLyCauHinh.NguoiDung.NHOMND_Control();
        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            if (txtDien_Giai.Text.Trim()!="")
            {
                nhomndctrl.updateData(txtMa_Nhom_ND,txtDien_Giai);
                if (done != null)
                {
                    done();
                }
            }
            else
            {
                MessageBox.Show("Dữ liệu không hợp lệ");
            }
        }

        private void btBack_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            nhomndctrl.loadForm_Edit(ma_nhom_nd, txtMa_Nhom_ND, txtDien_Giai);
        }
    }
}
